const path = require('path')
// const CompressionWebpackPlugin = require('compression-webpack-plugin')
// const productionGzipExtensions = ['js', 'css']


function resolve (dir) {
  return path.join(__dirname, dir)
}


module.exports = {
	chainWebpack: (config) => {
		config.resolve.alias
		.set('$static', resolve('/static'))
		.set('$api', resolve('/api'))
		.set('$pages', resolve('/pages'))
		.set('$mixins', resolve('/mixins'))
		.set('$utils', resolve('/utils'))
	}
	// configureWebpack: {
 //  	    plugins: [
 //  	        new CompressionWebpackPlugin({
 //  	            filename: '[path].gz[query]',
 //  	            algorithm: 'gzip',
 //  	            test: new RegExp('\\.('+productionGzipExtensions.join('|')+')$'),//匹配文件名
 //  	            threshold: 10240 * 5,//对10K以上的数据进行压缩
 //  	            minRatio: 0.8,
 //  	            deleteOriginalAssets:false,//是否删除源文件
 //  	        })
 //  	    ]
 //  	}
}
